Main: issue error when format doesn't support realtime tracking.
authorrobertl <robertl>
Sat, 2 Sep 2006 23:18:28 +0000 (23:18 +0000)
committerrobertl <robertl>
Sat, 2 Sep 2006 23:18:28 +0000 (23:18 +0000)
Msroute: ole header has unsigned char constants, so make it match.

main.c
msroute.c

diff --git a/main.c b/main.c
index 6acee034ef5e86f68aeba3f5e1a7e44474f9bbf2..59ff76ff91e2e7a8d0dd548fa221dcfe170b9146 100644 (file)
--- a/main.c
+++ b/main.c
@@ -446,6 +446,14 @@ main(int argc, char *argv[])
                        fatal("Realtime tracking (-T) is exclusive of other modes.\n");
                }
 
+               if (ovecs) {
+                       if (!ovecs->position_ops.wr_init || 
+                           !ovecs->position_ops.wr_position ||
+                           !ovecs->position_ops.wr_deinit) {
+                               fatal ("This output format does not support realtime positioning.\n");
+                       }
+               }
+
                while (1) {
                        wpt = ivecs->position_ops.rd_position();
                        if (wpt) {
index eadc4a8c8db7c285b9b847b763c552a7660fd33f..a616b58525aed6ab50b008799bf676440bdd4cee 100644 (file)
--- a/msroute.c
+++ b/msroute.c
@@ -70,7 +70,7 @@ typedef struct msroute_head_s
 
 #define BLOCKS(a, b) (((a) + (b) - 1) / (b))
 
-static const char ole_magic[8] =
+static const unsigned char ole_magic[8] =
 {
        0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1
 };
@@ -375,7 +375,7 @@ ole_init(void)
        memset(&head, 0, sizeof(head));
        fread(&head, sizeof(head), 1, fin);
        
-       is_fatal((strncmp(head.magic, ole_magic, sizeof(ole_magic)) != 0), MYNAME ": No MS document.");
+       is_fatal((strncmp(head.magic, (char *) ole_magic, sizeof(ole_magic)) != 0), MYNAME ": No MS document.");
 
        head.rev = le_read16(&head.rev);
        head.ver = le_read16(&head.ver);